/*
 *  Copyright 2020-2025 the original author or authors.
 *  You cannot use this file unless authorized by the author.
 */

package org.ipig.model.mapper;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * FieldMapper
 *
 * @author <a href="mailto:tansheng@zjport.gov.cn">tansheng</a>
 * @version $$Id: FieldMapper.java 5 2020-02-26 09:44:48Z ts <comchnts@163.com> $$
 * @since 1.0
 */
@Data
@ToString
@NoArgsConstructor
public class FieldMapper implements Serializable {
    /**
     * struct
     * @param name
     * @param toName
     */
    public FieldMapper(String name,String toName){
        this.name=name;
        this.toName=toName;
    }

    //原字段名
    private String name = "";
    //目标字段名
    private String toName = "";
    //原类型
    private String type;
    //目标类型
    private String toType;
    //目前仅针对日期格式有用[DateTimeCnst.Formatter]
    private String formatter;
    //日期格式通常为yyyyMMddHHmmss
    private String toFormatter;
    //默认值
    private String defaultValue;
    /**
     * 其它属性
     */
    private Map<String, String> props = new HashMap<String, String>();
}